<template>
          <!--<div class="filter-container">
            <el-input v-model="listQuery.name" size="small" placeholder="输入任务名称" style="width: 200px;" class="filter-item"
              @keyup.enter.native="handleFilter" />
            <el-button class="filter-item" size="small" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
            <el-button class="filter-item" size="small" type="defalut" icon="el-icon-close" @click="handleFilter" plain>清空</el-button>
          </div> -->
          <div class="task-items">
            <el-table :data="tabelData" size="small"  stripe style="width: 100%;" v-loading="listLoading">
              <el-table-column type="index" label="序号" width="55"></el-table-column>
              <el-table-column label="任务名称" min-width="280" align="left">
                  <template slot-scope="{row}">
                    <router-link :to="'/task-center/report/'+row.id">
                      <div>
                          <span class="subTask">{{ row.title }}</span>
                        <template v-if="!isHand">
                          <span class="overdue-text" v-if="row.overdue === '逾期'">{{ row.overdue }}</span>
                          <span class="overdue-text no-pub" v-if="!row.is_publish">未发布</span>
                        </template>
                      </div>
                    </router-link>
                    </template>
              </el-table-column>
              <el-table-column prop="data_type" label="上报类型" min-width="120"></el-table-column>
              <el-table-column prop="emergency_level" label="紧急程度" min-width="100">
                  <template slot-scope="{row}">
                    <el-tag :type="row.emergency_level | tagType">
                      {{ row.emergency_level }}
                    </el-tag>
                  </template>
                </el-table-column>
              <el-table-column label="截止日期" min-width="180">
                <template slot-scope="{row}">
                  <span>{{ parseTime(row.end_time) }}</span>
                </template>
              </el-table-column>
              <!-- <el-table-column label="操作" min-width="110" fixed="right">
                <template slot-scope="scope">
                  <router-link :to="'/task-center/preview/'+scope.row.id + '/?isHand=true&&reportView=true'">
                    <el-button type="text" size="small" >查看</el-button>
                  </router-link>
                  <router-link v-if="!isHand"  :to="'/task-center/report/'+scope.row.id">
                    <el-button type="text" size="small" :disabled="scope.row.overdue === '逾期'">数据填报</el-button>
                  </router-link>
                </template>
              </el-table-column> -->
            </el-table>
        </div>
      </template>
      <script>
        import { mapGetters } from 'vuex'
        import { getPendingTaskInfo } from '@/api/work.js'
        import { parseTime } from '@/utils'
        export default {
          name: 'IndexCenter',
          components: {
          },
          props:{
              tabelData:{
                  type: Array,
                  defalut: []
              },
              isHand:{
                  type: Boolean,
                  defalut: false
              }
          },
          watch: {
            previewObj(val){
              this.previewObj = val
            }
          },
          data() {
            return {
              total: 0,
              listLoading: false,
              listQuery: {
                page: 1,
                limit: 20,
                importance: '全部',
                name: undefined,
                type: '全部类别',
                year: '全部年度'
              },
              fileYearOptions: ['全部年度', '2019', '2018'],
              reportTypeOptions: ['全部类别'],
              importantOptions: ['紧急不重要'],
              dialogFormVisible:false,
              multipleSelection: [],
              taskList: [],
              previewObj:{}
            }
          },
          computed:{
            ...mapGetters([
              'id'
            ])
          },
          mounted() {
            // this.requestTaskList()
          },
          methods: {
            parseTime
          },
        }
      
      </script>
      <style lang="scss">
          .task-items {
            margin-top: 20px;
            .overdue-text{
              font-size: 12px;
              color: #fff;
              background: #ff6060;
              border-radius: 4px;
              padding: 1px 3px;
              margin-left: 2px;
            }
            .no-pub{
              background: #a1cfff;
            }
          
        }
      
      </style>
      <style>
      
      </style>
      